package com.guonl.rabbitmq.spring03;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringMain03 {
	
	@Autowired
    MQProducer mqProducer;
	
	public final String queue_key = "test_queue_key";
    
    @Test
    public void testMQ(){
    	
    	AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
                "classpath:spring/application-mq.xml");
        
        Map<String,Object> msg = new HashMap<>();
        msg.put("data","hello,rabbmitmq!");
        mqProducer.sendDataToQueue(queue_key,msg);
    	
    	
    }
    
}
